/*
 ============================================================================
 Name		: RtWeiboMainContainer.cpp
 Author	  : hou maoqing
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CRtWeiboMainContainer implementation
 ============================================================================
 */
#include "RtWeiboMainContainer.h"
#include "RtWeiboMainView.h"
#include "RtView.h"
#include "RtEnv.h"
#include "RtWeiboApp.h"
#include "RtComboBox.h"

CRtWeiboMainContainer::CRtWeiboMainContainer(CRtControl* pParent,CRtView* pView)
	:CRtContainer(pParent,pView)
	{
		m_pForm=NULL;
	}

CRtWeiboMainContainer::~CRtWeiboMainContainer()
	{
	}

void CRtWeiboMainContainer::ConstructL()
	{	
	CRtContainer::ConstructL();
		
	//Create control
	
	//****************************************************************
	/*CRtLabel* pLabel=new CRtLabel(this);	
	int nRowIndex=GetClientLayout()->AppendRow(pLabel,0,0);
	pLabel->SetText("Hello world!");*/
	m_pForm = new CRtXmlForm(this);
	GetClientLayout()->AppendCellToLastRow(m_pForm, -1, -1);
	CRtString strFormFile = CRtWeiboApp::Static()->GetXmlUiPath("Main.xml");
	m_pForm->LoadForm(strFormFile);
	//****************************************************************

	CRtRect rectClient=GetView()->GetUiManager()->GetClientRect();
	SetRect(rectClient);
	}

void CRtWeiboMainContainer::SizeChanged()
	{
	if(GetClientLayout())
	{
		GetClientLayout()->SetRect(Rect());
		GetClientLayout()->DoLayout();
	}
	
	this->DrawDeferred();
	}

void CRtWeiboMainContainer::Draw(CRtGc& gc,const CRtRect& rRect)
	{	
//	gc.SetPenStyle(ERtSolidPen);
//	gc.SetPenColor(KRtRgbBlack);
//	gc.SetBrushStyle(ERtNullBrush);
	
//	CRtRect r=CRtRect(50,50,50+50,50+53);
//	r.Grow(1,1);
//	gc.DrawRect(r);
	}

bool CRtWeiboMainContainer::HandleKeyEvent(const TRtKeyEvent& aKeyEvent,TRtKeyEventType aType)
	{
	return CRtContainer::HandleKeyEvent(aKeyEvent,aType);
	}

/*CRtSize CRtWeiboMainContainer::GetMinSize()
	{
	return CRtSize(0,0);
	}
*/

